package sharewithus.relation.dao;

import java.sql.Types;

import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @ClassName: RelationShipDBDAOImpl
 * @Description:
 * @author chenyun
 * @date 2012-5-17 下午01:48:44
 */
public class RelationShipDBDAOImpl implements IRelationShipDBDAO {

	private JdbcTemplate template;

	public void addRelationShip(String uid, String follower) throws Exception {
		String sql = "insert into pnn_user_relationship(user_id,fans_id) values(?,?)";
		template.update(sql, new String[] { uid, follower }, new int[] {
				Types.DECIMAL, Types.DECIMAL });
	}

	public void removeRelationShip(String uid, String follower)
			throws Exception {
		String sql = "delete from pnn_user_relationship where user_id = ? and fans_id = ?";
		template.update(sql, new String[] { uid, follower }, new int[] {
				Types.DECIMAL, Types.DECIMAL });

	}

	public JdbcTemplate getTemplate() {
		return template;
	}

	public void setTemplate(JdbcTemplate template) {
		this.template = template;
	}

}
